classdef spyfilt_fft < spyview_filter
   properties (Constant=true)
       name='fft';
       description='Take an FFT of the data';
       parameters=struct('name',{'Subtract Mean','Log','Phase/Power'},'type',{'bool','bool','bool'},'default',{1,0,0});
   end
   methods
       function [pm,px,py]=filter(sf,pm,px,py)
           if sf.values{1}
               pm=pm-mean(pm(:));
           end
           pm=fftshift(fft2(pm));
           if sf.values{3}
               pm=angle(pm);
           else 
               pm=abs(pm).^2;
               if sf.values{2}
                   pm=log(pm);
               end
           end           
       end
   end
end